(function () {
    'use strict';

    /**
     * @ngdoc function
     * @name webApp.controller:ConfigCtrl
     * @description
     * # ConfigCtrl
     * Controller of the webApp
     */
    angular.module('webApp')
        .controller('ConfigCtrl', ConfigCtrl);

    ConfigCtrl.$inject = ['$scope', 'dataService', 'helper', '$rootScope', '$location', 'sessionService', '$interval', '$state', 'ERP_CONFIG'];

    function ConfigCtrl($scope, dataService, helper, $rootScope, $location, sessionService, $interval, $state, ERP_CONFIG) {
        //
        $scope.addAction = function () {
            $scope.path = "/pages/admin/intro/search/index";
        }

        //获取二维码
        $scope.createQR = function () {
            return dataService.acodeGet(ERP_CONFIG.BackAppId, $scope.path, true).then(function (r) {
                $scope.dataimage = "data:image/png;base64," + r;
            });
        }


        //批量移除
        $scope.removeTester = function () {
            return dataService.adminUnbind($scope.testername).then(function (r) {
                // helper.myAlert(r.Msg);
            });
            //后端查询shop_config表，搜索
            //SELECT * FROM `shop_config` WHERE `field` LIKE '%_tester'
            //遍历value，找出来包含 输入微信的一条，
            //微信移除这个用户的体验者权限
            //移除value中这个微信，然后保存

        }
    }
})();